package com.sx.micowell.framework.view.dialog

import android.content.Context
import android.widget.TextView
import com.example.mvvm.rx.RxViewUntil
import com.sx.micowell.R
import com.sx.micowell.databinding.DialogErrorBinding
import com.sx.micowell.framework.model.Sport2Model
import com.sx.widget.app.dialog.BaseDialog

/**
 * @Description
 * @Author 梁浩文
 * @Date 2021/12/4 18:25
 */
class DialogError {
    class Builder(context: Context) :
        BaseDialog.Builder<DialogError.Builder>(context) {
        init {
            setCanceledOnTouchOutside(false)
            setCancelable(false)
            setContentView(R.layout.dialog_error)
            var bind = DialogErrorBinding.bind(contentView)
            RxViewUntil.setClickShake(bind.close) {
                dismiss()
            }
        }

        fun setError(error: String){
            findViewById<TextView>(R.id.error_info).text=error
        }
    }
}